#coding:utf-8
from rule34Lib.rule34Lib import rule34Lib

tagName="female"
cachePath="D:\cache"
startPid=0
endPid=42
proxyAddress="127.0.0.1"
proxyPort=1080
proxyUserPwd="7gugu:1234"

obj = rule34Lib(tagName,cachePath,startPid,endPid)
obj.setProxyServer(proxyAddress,proxyPort,proxyUserPwd)
while startPid <= endPid:
    arr = obj.imgList()
    for id in arr:
        imgLink = "https://rule34.xxx/index.php?page=post&s=view&id="+id
        downState=obj.imgDown(imgLink)
        if downState != False:
            print(obj.timeComp()+"[Fininshed]Link:"+imgLink+"\r\n")
        else:
            print(obj.timeComp() + "[UnFininshed]Link:" + imgLink + "\r\n")
    startPid = obj.getStartPid()
    startPid = startPid+42
    obj.setStartPid(startPid)
print("All have been downloaded!\r\n")









